import { uniFetch } from "@/pages/api/http.js";

// 获取工单列表数据
export const getOrderTabs = (params) => {
  return uniFetch({
    url: "/blade-repair/repairOrder/order-tabs",
    method: "get",
    data: params,
  });
};

/**
 * 获取工单详情
 * @param {string} id - 工单ID
 * @returns {Promise} - 返回工单详情数据
 */
export const getOrderDetail = (id) => {
  return uniFetch({
    url: "/blade-repair/repairOrder/detail",
    method: "GET",
    data: { id },
  });
};

// 获取维修记录列表
export const getRepairRecordList = (repairId) => {
  return uniFetch({
    url: "/blade-repair/repairRecord/list",
    method: "get",
    data: { repairId },
  });
};

// 获取维修班组列表
export const getRepairTeamList = (params) => {
  return uniFetch({
    url: "/repair-team/list",
    method: "get",
    data: params,
  });
};

// 获取维修人员列表
export const getRepairWorkerList = (params) => {
  return uniFetch({
    url: "/repair-worker/list",
    method: "get",
    data: params,
  });
};

// 提交派工信息
export const submitAssign = (data) => {
  return uniFetch({
    url: "/blade-repair/repairOrder/assign",
    method: "post",
    data,
  });
};
